package dao.pojo;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.TableGenerator;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TResourcetype entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_resourcetype", catalog = "fw")
public class ResourceType extends BasePojo implements java.io.Serializable {

	// Fields

	private Integer resourceTypeId;
	private String resourceTypeName;
	private Set<Resource> resources = new HashSet<Resource>(0);

	// Constructors

	/** default constructor */
	public ResourceType() {
	}


	// Property accessors
	@Id 
    @TableGenerator(name = "RESOURCETYPE_GEN", table = "sequence", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "SEQ_RESOURCETYPE", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "RESOURCETYPE_GEN")
    @Column(name="resourceTypeId", unique=true, nullable=false)
	public Integer getResourceTypeId() {
		return this.resourceTypeId;
	}

	public void setResourceTypeId(Integer resourceTypeId) {
		this.resourceTypeId = resourceTypeId;
	}

	@Column(name = "ResourceTypeName", length = 30)
	public String getResourceTypeName() {
		return this.resourceTypeName;
	}

	public void setResourceTypeName(String resourceTypeName) {
		this.resourceTypeName = resourceTypeName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "resourceType")
	public Set<Resource> getResources() {
		return this.resources;
	}

	public void setResources(Set<Resource> resources) {
		this.resources = resources;
	}
	public Object getEntityId() {
		return this.resourceTypeId;
	}
}